package com.hzxy.yiyid.web.module.repository.entity;

import com.hzxy.yiyid.web.common.constants.YiyidConstants;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @ClassName FeverClinicDo
 * @Description TOOD
 * @Author RAICOM2023
 * @Date 2023/3/6 16:47
 * @Version 1.0
 **/
@Data
@Entity
@Table(name = "fever_clinic")
public class FeverClinicDo implements Serializable {
    private static final long serialVersionUID = 352004242151901285L;

    @Id
    @Column(name = "id")
    @GenericGenerator(
            name = "generator_fever_clinic",
            strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator",
            parameters = {
                    @Parameter(name = "sequence_name", value = "s_fever_clinic"),
                    @Parameter(name = "initial_value", value = "1"),
                    @Parameter(name = "increment_size", value = "1")
            }
    )
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "generator_fever_clinic")
    private Long id;

    /**
     * 机构名称
     */
    @Column(name = "jgmc")
    private String jgmc;

    /**
     * 地址
     */
    @Column(name = "dz")
    private String dz;

    /**
     * 区县名称
     */
    @Column(name = "qxmc")
    private String qxmc;

    /**
     * 省
     */
    @Column(name = "province")
    private String province;

    /**
     * 省编码
     */
    @Column(name = "province_code")
    private String provinceCode;

    /**
     * 市
     */
    @Column(name = "city")
    private String city;

    /**
     * 市编码
     */
    @Column(name = "city_code")
    private String cityCode;

    /**
     * 区县
     */
    @Column(name = "county")
    private String county;

    /**
     * 区县编码
     */
    @Column(name = "county_code")
    private String countyCode;

    /**
     * 街道（乡/镇）
     */
    @Column(name = "town")
    private String town;

    /**
     * 街道（乡/镇）编码
     */
    @Column(name = "townCode")
    private String townCode;

    /**
     * 详细地址
     */
    @Column(name = "detail")
    private String detail;

    /**
     * 纬度
     */
    @Column(name = "lat")
    private Double lat;

    /**
     * 经度
     */
    @Column(name = "lng")
    private Double lng;

    /**
     * 保存时间
     */
    @Column(name = "save_time")
    @DateTimeFormat(pattern = YiyidConstants.DATE_FORMAT_DEFAULT_VIEW)
    private Date saveTime = new Date();

    /**
     * 修改时间
     */
    @Column(name = "update_time")
    @DateTimeFormat(pattern = YiyidConstants.DATE_FORMAT_DEFAULT_VIEW)
    private Date updateTime;

    public FeverClinicDo(){

    }

    public FeverClinicDo(String jgmc, String dz, String qxmc, String province, String provinceCode, String city
            , String cityCode, String county, String countyCode, String town, String townCode, String detail
            , Double lat, Double ing) {
        this.jgmc = jgmc;
        this.dz = dz;
        this.qxmc = qxmc;
        this.province = province;
        this.provinceCode = provinceCode;
        this.city = city;
        this.cityCode = cityCode;
        this.county = county;
        this.countyCode = countyCode;
        this.town = town;
        this.townCode = townCode;
        this.detail = detail;
        this.lat = lat;
        this.lng = ing;
        this.saveTime = new Date();
    }
}
